using UnityEngine;
using System.Collections;
using Botanicraft;

public class CreateTreeExample : MonoBehaviour 
{
    Botanicraft.TreeCreator2D treeCreator;
    public Texture2D bark;
    public Texture2D barkNormal;
    public Texture2D leaf;

    public float growDist = 1f;
    public float maxDist = 2f;
    public float minDist = 1.5f;

	// Use this for initialization
	void Start () 
    {
        treeCreator = new TreeCreator2D();
        treeCreator.bark = bark;
        treeCreator.barkNormal = barkNormal;
        treeCreator.leaf = leaf;
	}
	
	// Update is called once per frame
	void Update () 
    {
        if (Input.GetKeyDown("n"))
        {
            float tmp = Time.realtimeSinceStartup;
            for (int i = 0; i < 1; i++)
            {
                treeCreator.CreateTree(/*(int)Botanicraft.TreeType.Broadleaves.Acacia*/ 1, Vector3.zero, true, growDist, maxDist, minDist);
            }
            float renderTime = (Time.realtimeSinceStartup - tmp) / 1;
            Debug.Log("Average Time for Generation: " + renderTime.ToString("f6"));
        }
	}
}
